package com.geek.javase.ch06.test3;

/*
 *@author wangpeng
 *2025/10/14 23:11
 *@description TODO
 */
//9.学生类：姓名，学号，出生日期  三个属性。找出比“张三"大的所有同学信息。
public class Student {
    private String name;
    private String id;
    private String birth;

    public Student(String name, String id, String birth) {
        this.name = name;
        this.id = id;
        this.birth = birth;
    }
    public Student() {
    }
    public static void main(String[] args) {
        Student[] students = new Student[4];
        students[0] = new Student("张三", "20140101", "2002-01-01");
        students[1] = new Student("李四", "20140102", "1997-01-01");
        students[2] = new Student("王五", "20140103", "2020-01-01");
        students[3] = new Student("赵六", "20140104", "1003-01-01");
        // 找出比“张三"年龄大的所有同学信息
        for (Student student : students) {
            if (student.getBirth().compareTo(students[0].getBirth()) < 0) {
                System.out.println(student);
            }
        }

    }

    public String getName() {
        return name;
    }

    public String getId() {
        return id;
    }

    public String getBirth() {
        return birth;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setId(String id) {
        this.id = id;
    }

    public void setBirth(String birth) {
        this.birth = birth;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", id='" + id + '\'' +
                ", birth='" + birth + '\'' +
                '}';
    }
}
